#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "serialmaster.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:

    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void writeLogMsg(const char *str);
    void writeLogMsg(QString msg);

private slots:
    void on_checkBoxSerialAuto_stateChanged(int arg1);

    void on_checkBoxLockNumAuto_stateChanged(int arg1);

    void on_connectButton_clicked();

    void onSerialConntionChanged(bool isConnected);

    void on_reloadButton_clicked();

private:
    Ui::MainWindow *ui;
    SerialMaster *master;
    QList<SerialMaster::Info> infos;

    void updateAvailablePortList();
};

#endif // MAINWINDOW_H
